module WebsitestasksHelper
  def last_updated_at_column(record) 
    if record.last_updated_at.nil? 
      "" 
    else   
      record.last_updated_at.strftime("%d/%m/%Y %H:%M:%S")
    end
  end
  
  def last_accessed_at_column(record)    
    if record.last_accessed_at.nil? 
      "" 
    else
      record.last_accessed_at.strftime("%d/%m/%Y %H:%M:%S")
    end
  end
  
  def iscurrent_column(record) 

  
  currwebsn = Websitesinf.find_by_iscurrent(true)
  if currwebsn.nil?
      radio_button_tag 'record[iscurrent]', 0, false,:onclick =>remote_function({ :url=>{:controller=>'websitestasks',:action=>'setdefws',:id=>record.id}})
  else
  
	  if record.name == currwebsn.name
	    radio_button_tag 'record[iscurrent]', 1, true,:onclick =>remote_function({ :url=>{:controller=>'websitestasks',:action=>'setdefws',:id=>record.id}})
	  else
	    radio_button_tag 'record[iscurrent]', 0, false,:onclick =>remote_function({ :url=>{:controller=>'websitestasks',:action=>'setdefws',:id=>record.id}})
	  end
	end


  end
end
